﻿@* thanks http://orchardproject.net/gallery/List/Modules/Orchard.Module.Szmyd.Orchard.Modules.Menu *@

@using Orchard.ContentManagement;
@using Orchard.Widgets.Models;
@{
    var widget = ((IContent) Model.ContentItem).As<WidgetPart>();
    var title = widget.RenderTitle ? widget.Title : "";
    var tag = Tag(Model, "article");
}
@* Strip wrapper for menu widget when displayed in Navigation zone and for Breadcrumbs part. *@
@if ((widget.TypeDefinition.Name == "MenuWidget" && widget.Zone == "Navigation"))
{
    @Display(Model.Child)
}
else
{
    @tag.StartElement
    if (HasText(title) || Model.Header != null)
    {
        <header>
            @if (HasText(title))
            {
                <h1>@title</h1>
            }
            @Display(Model.Header)
        </header>
    }
    @Display(Model.Child)
    if (Model.Footer != null)
    {
        <footer>
            @Display(Model.Footer)
        </footer>
    }
    @tag.EndElement
}
